<?php

namespace App\Http\Controllers\home;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use DB;
class ShopController extends Controller
{
    
    public function Index()
    { if(session('web') == 2){
        // 关闭状态
        $webconfig = DB::table('webconfig') -> first();
        return view('home/webconfig/index',['webconfig'=> $webconfig]);
       }else{
       		// 获取photo 
    	$photo = DB::table('photo') -> get();
    	// dd($photo[3]);
    	$data = DB::table('goods') ->where('status','1')-> get();
      // dd($data);
    	
        return view('/home/shop/index',['photo'=>$photo[3],'data'=>$data]);
       }
    
    }

   
}
